<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>${page.pageName}</title>
<%@include file="/common/public.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/css/main.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/query.css">
<script type="text/javascript" src="${ctx}/js/editarea/edit_area_full.js"></script>
<script type="text/javascript">
window.Parent = window.dialogArguments;
window.Action = {};
Action.save = function(){
	var tableConfig = codeEditor.getValue("tableConfig");
	jQuery("#tableConfig").val(tableConfig);
	jQuery("form:first").submit();
};
Action.complete = function( id ){
	if( jQuery("#id").val() == ""){
		jQuery("#id").val(id);//新增完成获取ID
		Parent["Action"].addTableConfig({value:id,text:jQuery("#tableName").val()});
	}
};
jQuery( function(){
	if( "" == "${bean.tableId}"){
		var pageName = jQuery("#pageName",Parent.document).val();
		jQuery("#tableName").val(pageName);
	}
	// 初始化编辑器
	codeEditor.init({
		id: "tableConfig"		
		,start_highlight: true
		,allow_resize: "both"
		,allow_toggle: true
		,word_wrap: false
		,language: "zh"
		,syntax: "xml"
	});
});
</script>
</head>
<body>
<e:form name="EditForm" action="/page/config/tableConfigSave.do">
<e:hidden name="id" value="${bean.tableId}"/>
<e:hidden name="tableTypeId" value="${bean.tableTypeId}">
	<e:param name="defValue" value="1"/>
</e:hidden>
<e:hidden name="tableSortId" value="${bean.tableSortId}">
	<e:param name="defValue" value="1"/>
</e:hidden>
<table class="etable">
	<tr>
		<td class="tl" width="20">表格名称：</td>
		<td class="tc">
			<e:text name="tableName" className="input" validate="{required:true,maxlength:128}" value="${bean.tableName}">
				<e:param name="defValue" value=""/>
			</e:text>
		</td>
		<td class="tl">表格编码：</td>
		<td class="tc">
			<e:text name="tableCode" className="input" validate="{required:true,maxlength:128}" value="${bean.tableCode}">
				<e:param name="defValue" value="${bean.tableCode}"/>
			</e:text>
		</td>
	</tr>
	<tr>
		<td class="tl">表格说明：</td>
		<td class="tc" colspan="3">
		<e:textarea name="tableDesc" style="width:100%; height:50px" validate="{required:false}" value="${page.tableDesc}"/></td>
	</tr>
	<tr>
		<td class="tl"  width="10%">表格配置：</td>
		<td class="tc" colspan="3" width="90%">
			<e:textarea name="tableConfig" style="width:720px; height:520px" value="${bean.tableConfig}" validate="{required:true}">
				<e:param name="defValue" value="${tableConfig}"/>
			</e:textarea>
		</td>
	</tr>
	<tr>
		<td align="center" colspan="4" height="30">
		<input id="SaveButton" type="button" class="btn_orange_b2" value="保 存" onClick="Action.save()"/>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input id="SaveButton" type="button" class="btn_blue_b2" value="关 闭" onClick="window.close()"/>
		</td>
	</tr>
</table>
</e:form>
</body>
</html>